function getShortDis(point, points) {

	// 得到点到范围上每个点的距离。排序拿到最短的2个。以这2个点+外点 做三角形算最短距离
	var disArray = [];
	for (var i = 0; i < points.length; i++) {
		var disI = map.getDistance(point, points[i]);// 计算地图上点到点的距离
		disArray.push(disI);
	}
	// 顺序推导
	var newArray = disArray.slice();// 复制数组，为的是不影响原数组的数据
	newArray.sort(function(n1, n2) {
		return n1 - n2;
	}); // 数值类型的排序

	// 以最短的两条边找到合适的三角形
	var ac = newArray[0]; // 若以下判断都不适用时，直接返回ac
	var bc = newArray[1];
	var isNeighber = false;
	var isAcuteAngle = false;
	var pointA, pointB, m, n;
	// 以距离得到AB 的坐标点
	for (var i = 0; i < disArray.length; i++) {
		if (ac == disArray[i]) {
			pointA = points[i];
			showMarker(pointA, "A:" + ac);
			showLine(point, pointA);
			m = i;
		}
		if (bc == disArray[i]) {
			pointB = points[i];
			showMarker(pointB, "B:" + bc);
			showLine(point, pointB);
			n = i;
		}
	}
	// 以2点下标差值的绝对值判断仍需要计算几个多边形
	isNeighber = Math.abs(m - n) == 1;
	isAcuteAngle = ifAcuteAngle(pointA, pointB, point);
	if (isNeighber && isAcuteAngle) {

		return getH(pointA, pointB, point, disArray);

	} else {

		// 是相邻的，但是是钝角。则直接以第三点为判断，若第三点也为钝角，直接以最短边为距离返回，若第3点不是钝角，则求高后进行比较再返回
		if (isNeighber) {

			var dc = newArray[2];
			var pointD = point[getIndex(dc, disArray)];
			// 判断ACD 和BCD 是否是相邻且是钝角
			if (iFNeighber(pointA, pointD, point, disArray)
					&& ifAcuteAngle(pointA, pointD, point)) {
				var h = getH(pointA, pointD, point, disArray);
				return h < ac ? h : ac;
			} else if (iFNeighber(pointB, pointD, point, disArray)
					&& ifAcuteAngle(pointB, pointD, point)) {
				var h = getH(pointB, pointD, point, disArray);
				return h < ac ? h : ac;
			} else {
				return ac;
			}

		} else {
			// 不是相邻的，需要计算中间所有点的
			var num = Math.abs(m - n);// 中间点的个数
			var hArray = [];
			for (var k = 0; k < num; k++) {

				// 取到中间的每个点，组合三角形。
				var nc = disArray[k + 2];
				var pointN = points[getIndex(nc, disArray)];
				var ha = getH(pointA, pointN, point, disArray);
				var hb = getH(pointB, pointN, point, disArray);
				var min = Math.min(ac, ha, hb);
				if (min < ac) {
					hArray.push(min);
				}
			}

			if (hArray.length == 0) {

				return ac;

			} else {

				// 取数组中最小的那个值
				hArray.sort(function(n1, n2) {
					return n1 - n2;
				});
				return hArray[0];
			}

		}
	}

}

// 根据距离，得到下标
function getIndex(dis, disArray) {

	for (var i = 0; i < disArray.length; i++) {

		if (dis == disArray[i]) {

			return i;
		}
	}

}

// 是否相邻：
function iFNeighber(pointA, pointB, pointC, disArray) {

	var ab = map.getDistance(pointA, pointB);
	var ac = map.getDistance(pointA, pointC);
	var bc = map.getDistance(pointB, pointC);

	var m, n;
	// 找出下标：
	m = getIndex(ac, disArray);
	n = getIndex(bc, disArray);

	return Math.abs(m - n) == 1;
}

// 是否锐角三角形：
function ifAcuteAngle(pointA, pointB, pointC) {

	// 求三边长：ab ac bc
	var ab, ac, bc;
	var result = false;
	ab = map.getDistance(pointA, pointB);
	ac = map.getDistance(pointA, pointC);
	bc = map.getDistance(pointB, pointC);
	return result = ((ab * ab + ac * ac - bc * bc) > 0)
			&& ((ab * ab + bc * bc - ac * ac) > 0);

}

// 根据面积法得到C到AB的高，即范围外一点到多边形的最短距离
function getH(pointA, pointB, pointC, disArray) {
	var ab, ac, bc, h;
	var ab = map.getDistance(pointA, pointB);
	var ac = map.getDistance(pointA, pointC);
	var bc = map.getDistance(pointB, pointC);
	if (iFNeighber(pointA, pointB, pointC, disArray)
			&& ifAcuteAngle(pointA, pointB, pointC)) {
		var p = (ab + ac + bc)/2 ; //半周长
		var S = Math.sqrt(p * (p - ab) * (p - bc) * (p - ac));// 面积
		h = 2 * S / ab;
		return h < ac ? h : ac
	}
	return ac;
}